package com.sxbbc.common.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sxbbc.common.core.entity.jz.AgAccount;
import com.sxbbc.common.core.mapper.jz.AgAccountMapper;
import com.sxbbc.common.core.mapper.jz.AgMoneyDetailMapper;
import com.sxbbc.common.core.service.IAgAccountService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 代理资金账户表 服务实现类
 * </p>
 *
 * @author leehao
 * @since 2019-07-10
 */
@Service
public class AgAccountServiceImpl extends ServiceImpl<AgAccountMapper, AgAccount> implements IAgAccountService {

    @Autowired
    private AgAccountMapper agAccountMapper;
    @Autowired
    private AgMoneyDetailMapper agMoneyDetailMapper;

    @Override
    public AgAccount selectByAgid(Integer agid) {
        QueryWrapper<AgAccount> wrapper = new QueryWrapper<>();
        wrapper.eq("agid", agid);
        return super.getOne(wrapper);
    }

    @Override
    public boolean updateByAgid(AgAccount agAccount) {
        QueryWrapper<AgAccount> wrapper = new QueryWrapper<>();
        wrapper.eq("agid", agAccount.getAgid());
        return super.update(agAccount, wrapper);
    }

}
